package com.compose.universally.okhttp

object OKHttpConfig {
    /**
     * 如果字段名和默认的一样可以直接使用只含有data的Bean作为模板类，不会用的建议不要设置
     */
    var useDefaultStr = true

    fun setSuccessCode(successCode: Int): OKHttpConfig {
        OKHttpBaseCallBack.successCode = successCode
        return this
    }


    fun setHeader(map: Map<String, Any>) {
        OKHttpBaseCallBack.headerMap.clear()
        OKHttpBaseCallBack.headerMap.putAll(map)
    }

    fun setDataStr(code: String, msg: String, data: String): OKHttpConfig {
        useDefaultStr = false
        OKHttpBaseCallBack.code = code
        OKHttpBaseCallBack.msg = msg
        OKHttpBaseCallBack.data = data
        return this
    }
}